<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>${article.title!''}</title>
	[#include "/theme/adminlte/common/sites.html" /]
	[@header /]
</head>
<!-- ADD THE CLASS layout-top-nav TO REMOVE THE SIDEBAR. -->
<body class="hold-transition skin-blue layout-top-nav">
<div class="wrapper">

	<header class="main-header">
		[@nav  2 /]
	</header>
	<!-- Full Width Column -->
	<div class="content-wrapper">
		<div class="container">
			<!-- Main content -->
			<section class="content">
				<div class="row">
					<section class="col-lg-8">
						<div class="box box-widget">
							<div class="box-header with-border">
								<div class="user-block">
									<img class="img-circle" src="${httpsurl}dist/img/user1-128x128.jpg" alt="头像">
									<span class="username"><a href="#">${article.title!""}</a></span>
									<span class="description">${(article.lastDate?string("yyyy年MM月dd日"))!""}</span>
								</div>
							</div>
							<!-- /.box-header -->
							<div class="box-body">
								<div class="pad">
									<div>${article.contents!""}</div>
									<div>
										[#include "/theme/adminlte/article/ads.html"]
										[@ad /]
									</div>
								</div>
								[@shiro.authenticated]
								<button id="like" type="button" class="btn btn-default btn-xs"><i class="fa fa-thumbs-o-up"></i>点赞</button>
								[/@shiro.authenticated]
								<span class="pull-right text-muted">${article.likes!"0"}喜欢 - ${article.comments!"0"}个评论</span>
							</div>
							<!-- /.box-body -->
							<div class="box-footer box-comments">
								[#if pageData?? && pageData.content??]
                                 [#list pageData.content as item]
								<div class="box-comment">
									<!-- User image -->
									<img class="img-circle img-sm" src="${(item.user.avatar)!'dist/img/avatar04.png'}" alt="头像">

									<div class="comment-text">
									  <span class="username">
										${(item.user.name)!""}
										<span class="text-muted pull-right">${item.addDate!""}</span>
									  </span><!-- /.username -->
										${item.contents!""}
									</div>
									<!-- /.comment-text -->
								</div>
								[/#list]
								[/#if]
								<!-- /.box-comment -->
							</div>
							<!-- /.box-footer -->
							[@shiro.authenticated]
							<div class="box-footer">

								<form action="${httpsurl}article/comment.htm" method="post">
									<input  type="hidden" name="article.id" value="${article.id}"/>
									<div class="input-group">
										<input required="required" name="contents" placeholder="请输入评论内容 ..." class="form-control" type="text">
										<span class="input-group-btn">
											<button type="submit" class="btn btn-primary btn-flat">评论</button>
										</span>
									</div>
								</form>
							</div>
							[/@shiro.authenticated]
							<!-- /.box-footer -->
						</div>
					</section>
					<section class="col-lg-4">
						[#if article.user??]
						  [@userinfo user=article.user /]
						[/#if]
					</section>
				</div>

			</section>
			<!-- /.content -->
		</div>
		<!-- /.container -->
	</div>
	<!-- /.content-wrapper -->

	[@footer /]
</div>
<!-- ./wrapper -->

[@scripts /]

<script type="text/javascript">
	$(document).ready(function () {
		$("#like").click(function () {
		    var params={};
		    params.id=${article.id};
			$.post("${httpsurl}article/like.htm",params,function (backdata) {
               alert(backdata.msg);
            });
        });
    });
</script>
</body>
</html>
